﻿<%@ Page Title="" Language="C#" MasterPageFile="~/template.Master" AutoEventWireup="true" CodeBehind="ContactEdit.aspx.cs" Inherits="SystemDirectory.ContactEdit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style>
        .tabContents
        {
            border: 1px solid #ccc;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
            margin: 5px;
            min-height: 350px;
            padding: 10px;
            padding-top: 15px;
        }
        .top
        {
            border: 0px solid #ccc;
            overflow: hidden;
            padding: 0;
            margin: 0;
            padding-bottom: 2px;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
        }
        .top-left
        {
            border: 0px solid #ccc;
            font: bold 14px Arial, Verdana, Helvetica, sans-serif;
            float: left;
            padding: 5px 0;
        }
        .top-right
        {
            border: 0px solid #ccc;
            float: right;
            text-align: right;
        }
        .details1
        {
            overflow: hidden;
        }
        .content-left
        {
            float: left;
            padding-right: 50px;
        }
        .content-right
        {
        }
        .frm div
        {
            display: table;
            position: static;
            margin-bottom: 15px;
        }
        .frm div label
        {
            width: 150px;
            word-wrap: break-word;
            display: table-cell;
            vertical-align: middle;
            position: static;
        }
        .frm textarea
        {
            width: 260px;
            height: 80px;
        }
        .frm input[type="text"], input[type="password"]
        {
            width: 260px;
        }
        .frm input[type="button"]
        {
            float: right;
        }
        .frm select
        {
            width: 270px;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#modalLookup').modal('show');
            $('#ContentPlaceHolder1_manager_name').attr("readonly", "readonly");
        });

        function btnModalClick() {
            $('#modalLookup').modal('show');
        }

        function btnSelect_click() {
            $('#modalLookup').modal('hide');
            $('#ContentPlaceHolder1_manager_name').val($('#select:checked').val());
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content">
        <div id="mainContainer">
            <div class="box">
                <div id="container-orglst">
                    <h4>
                        <a href="#">Search Contact</a>
                    </h4>
                    <h1>
                        Edit Contact</h1>
                    <div id="Details" class="tabContents details1">
                        <form>
                        <div class="content-left frm">
                            <div>
                                <label for="first_name">
                                    First Name <span style="color: red;">*<span></label>
                                <asp:TextBox ID="first_name" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="sur_name">
                                    SurName <span style="color: red;">*<span></label>
                                <asp:TextBox ID="sur_name" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="known_as">
                                    Known As</label>
                                <asp:TextBox ID="known_as" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="office_phone">
                                    Office Phone</label>
                                <asp:TextBox ID="office_phone" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="mobile_phone">
                                    Mobile Phone</label>
                                <asp:TextBox ID="mobile_phone" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="home_phone">
                                    ST Home Phone</label>
                                <asp:TextBox ID="home_phone" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="email">
                                    Email Address
                                </label>
                                <asp:TextBox ID="email" runat="server"></asp:TextBox>
                            </div>
                        </div>
                        <div class="content-right frm">
                            <div>
                                <label for="manager_name">
                                    Manager Name
                                </label>
                                <asp:TextBox ID="manager_name" runat="server"></asp:TextBox>
                                <%--<a id="testAnchor" role="button" data-toggle="modal" href="#" style="margin-left:10px" onclick="btnModalClick()" >Lookup</a>--%>
                                <asp:LinkButton ID="lbnModal" runat="server" OnClick="lbnModal_Click">Lookup</asp:LinkButton>
                            </div>
                            <!--                        <div id="modalLookpup" class="modal fade hide" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true" style="width:200px; height:200px; background-color:Gray;">
                            <div class="modal-header">Test header</div>
                            <div class="modal-body"> Test body</div>
                            <div class="modal-footer">Test footer</div>
                        </div>-->
                            <div>
                                <label for="contact_type">
                                    Contact Type <span style="color: red;">*<span></label>
                                <asp:DropDownList ID="contact_type" runat="server">
                                </asp:DropDownList>
                            </div>
                            <div>
                                <label for="contact_method">
                                    Best Contact Method</label>
                                <asp:DropDownList ID="contact_method" runat="server">
                                </asp:DropDownList>
                            </div>
                            <div>
                                <label for="job_role">
                                    Job Role
                                </label>
                                <asp:TextBox ID="job_role" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="workbase">
                                    Workbase</label>
                                <asp:TextBox ID="workbase" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="job_title">
                                    Job Title</label>
                                <asp:TextBox ID="job_title" runat="server"></asp:TextBox>
                            </div>
                            <div>
                                <label for="is_active">
                                    Is Active?</label>&nbsp;
                                <asp:CheckBox ID="is_active" runat="server" />
                            </div>
                        </div>
                        </form>
                    </div>
                    <div>
                        <a href="ContactList.aspx">
                            <input type="button" class="btn btn-primary" value="Back" style="float: right; margin-left: 10px" />
                        </a>
                        <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn btn-primary" OnClick="btnSave_Click" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <asp:TextBox ID="txtId" runat="server" Visible="false" />
    <!-- Modal -->
    <div id="wrap" runat="server">
        <div id="modalLookup" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
            style="width: 60%; margin-left: -30%" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×</button>
                <h3 id="myModalLabel">
                    List Contact</h3>
            </div>
            <div class="modal-body">
                <div class="tabDetails" style="height: 50px">
                    <div class="field">
                        <label for="postcode" style="display: inline-block; margin-left: 5px; margin-right: 15px">
                            First Name :
                        </label>
                        <asp:TextBox ID="txtFirstName" CssClass="searchText" runat="server"></asp:TextBox>
                        <label for="street" style="display: inline-block; margin-left: 30px">
                            Surname :
                        </label>
                        <asp:TextBox ID="txtSurName" CssClass="searchText" runat="server"></asp:TextBox>
                    </div>
                </div>
                </br>
                <div>
                    <!--<input type="button" value="Search Contact" class="btn btn-primary" style="margin-right:10px" />-->
                    <asp:Button ID="btnSearch" runat="server" Text="SearchContact" CssClass="btn btn-primary"
                        OnClick="btnSearch_Click" />
                    <input type="button" value="None" class="btn btn-primary" style="margin-right: 10px" />
                    <input type="button" value="Clear" class="btn btn-primary" style="margin-right: 10px" />
                    <a href="ContactCreate.aspx">
                        <input type="button" class="btn btn-primary" value="Create" /></a>
                </div>
                </br>
                <div>
                    <asp:CheckBox ID="cbxInactive" Text="Include in-active contact?" CssClass="checkbox inline"
                        runat="server" AutoPostBack="True" OnCheckedChanged="cbxInactive_CheckedChanged" />
                </div>
                <div class="div-table">
                    <asp:Repeater ID="rptContact" runat="server">
                        <HeaderTemplate>
                            <table width="100%" class="table-striped table-bordered">
                                <thead>
                                    <tr style="background: #006dcc">
                                        <th>
                                        </th>
                                        <th>
                                            Contact Name
                                        </th>
                                        <th>
                                            Mobile Phone
                                        </th>
                                        <th>
                                            Email
                                        </th>
                                        <th>
                                            Contact Type
                                        </th>
                                        <th>
                                            Is Active?
                                        </th>
                                        <th>
                                            Note
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <input type="radio" name="select" id="select" value="<%#Eval("ContactId") %>" onselect="testFunction()" />
                                    <input type="hidden" name="id" value="<%#Eval("ContactId") %>" />
                                </td>
                                <td>
                                    <%#Eval("FirstName") %>
                                </td>
                                <td>
                                    <%#Eval("MobilePhone") %>
                                </td>
                                <td>
                                    <%#Eval("Email") %>
                                </td>
                                <td>
                                    <%#Eval("ContactTypeID") %>
                                </td>
                                <td>
                                    <%#Eval("IsActive") %>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </tbody> </table>
                        </FooterTemplate>
                    </asp:Repeater>
                    </br> <span class="pagelinks" style="float: right;"><span class="icon icon-step-backward">
                        <a href="#"></a></span><span class="icon icon-backward"><a href="#"></a></span>Page
                        <input style="font-size: 12px; width: 35px; padding: 2px;" class="curpage" type="text"
                            name="b" value="1" />
                        of <span class="nops">1</span> <span class="icon icon-forward"><a href="#"></a></span>
                        <span class="icon icon-step-forward"><a href="#"></a></span></span>
                </div>
                <div class="form-inline">
                    <input type="button" value="Select" class="btn btn-primary" style="margin-top: 40px;
                        margin-right: 10px" onclick="btnSelect_click()" />
                    <input type="button" value="Edit" class="btn btn-primary" style="margin-top: 40px;
                        margin-right: 10px" />
                    <input type="button" class="btn btn-primary" value="Close" style="margin-top: 40px;
                        margin-right: 10px" />
                </div>
            </div>
            <%--            <div class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">
                    Close</button>
                <button class="btn btn-primary">
                    Save changes</button>
            </div>--%>
        </div>
    </div>
</asp:Content>
